<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head th:include="public/page_css::page_css ('添加上架库位')"/>

<body>
<div class="layui-fluid larry-wrapper">
    <div class="layui-row layui-col-space30">
        <div class="layui-col-xs24">
            <section class="panel panel-padding">
                <form id="form1" class="layui-form layui-form-pane" action="">
                    <div class="step-content" id="simplewizardinwidget-steps">
                        <div class="step-pane active" id="simplewizardinwidgetstep1">
                            <div>&nbsp;</div>
                            <!--<input type="hidden" name="id">-->
                            <!--<div class="layui-form-item">
                                <div class="layui-inline">
                                    <label class="layui-form-label">上架库位</label>
                                    <div class="layui-input-inline">
                                        <select lay-ignore="lay-ignore" class="js-data-example-ajax" id="mc"
                                                name="mc" select2 style="width: 193px"></select>
                                    </div>
                                </div>
                            </div>-->

                            <div class="layui-inline">
                                <label class="layui-form-label">上架库位</label>
                                <div class="layui-input-inline">
                                    <select lay-ignore="lay-ignore" class="js-data-example-ajax" id="mc"
                                            name="mc" select2 style="width: 193px"></select>
                                </div>
                            </div>
                        </div>
                        <!--<input type="hidden" th:value="${id}" id="kid">-->
                    </div>
                </form>
            </section>
        </div>
    </div>
</div>
</body>
<div th:include="public/public_js::public_js"></div>

<script th:inline="javascript">
</script>
<script>
    layui.use(['myform', 'zzpUtils', 'form', 'jquery'], function () {
        var form = layui.form,
            zzpUtils = layui.zzpUtils,
            $ = layui.jquery;
        zzpUtils.select2({
            elem: "#mc",
            url: "/wmsfailedlibrary/searchKw",
            minimumInputLength: 0,
            /*data: function (params) {
                /!*var query = {
                    show_kwid: params.term,
                };*!/

                var show_kwid=$("#mc").val();
                return JSON.stringify(show_kwid);
            },*/
            //minimumInputLength: 1,    //搜索框至少要输入的长度，此处设置后需输入才显示结果

        });


        //var ids = $("#kid").val();
        /*zzpUtils.action({
            url: "/wmsEstimatedArrivalOrderDetailed/ConfirmationASN",
            data: JSON.stringify({}),
            success: function (data) {
                zzpUtils.loadJsonDataToForm(data);
            }, error: function (xhr, textStatus) {
                console.log(textStatus);
                console.log(xhr)
            }
        });*/

        window.submitFunction = function (data) {
            console.log("来提交了");
            console.log(data);
        }
        form.on("submit(form1btn)", function (data) {
            var kw = $("#mc").select2("data")[0].text;
            //alert(hpbh)
            zzpUtils.confirm("是否确定添加", function (index) {
                /*parent.$('#xssl').val(data.field.xssl);//现收数量
                parent.$('#pssl').val(data.field.pssl);//破损数量*/
                 parent.$('#mc').val(kw);//上架收货
                /*parent.$('#jssl').val(data.field.jssl);//拒收数量
                parent.$('#jsyy').val(data.field.jsyy);//拒收原因*/
                /*parent.$('#pid').val(1);//判断*/
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭

            })
            $("#form1btn").remove();
            return false;
        });
    });

</script>
</html>